<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VUE Template</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        姓：<input type="text" v-model="userInfo.firstName"><br>
        名：<input type="text" v-model="userInfo.lastName"><br>
        全名：<span>{{fullName()}}</span>
    </div>
</body>
    <script type="text/javascript">
        
        const vm = new Vue({
            el:'#root',
            data:function(){
                return{
                    firstName:'张',
                    lastName:'三'
                }
            },
            methods:{
              fullName(){
                  return this.firstName+this.lastName;
              }
          }
        })
    </script>
</html>